<?php

/**
 * Always required for all pages to use MoltenBlob
 */
require('config.php');

$username = "bottle";
$password = "pimp";

$xyz = $USER->auth($username, $password);

if($xyz) { 
	print "<br />Auth Success" ;
	} 
else { 
	print "<br />Auth Fail"; 
}

print "<br />Session content on index.php: <pre>";
var_dump($_SESSION);
print "</pre>";




//print "<br />fetching table names and optimizing them";
/*foreach($DB->getTables() as $t) {
	$DB->optimizeTable($t);
}
*/


// testing nukeRows
/*
$r = $DB->nukeRows(TBL_USER, 'password', 'heathenpride', 'lastname', 'Bach');
print "<br />Number of deleted rows: $r (false = error)";
*/


// testing add()
/*	print "<br />Setting user data fields...";
	$USER->set('username', 'COOOT');
	$USER->set('password', 'cooticile');
	$USER->set('name', 'Nael');
	$USER->set('lastname', 'FOOF');
	$USER->set('email', 'knipper@lakker.net');
	$USER->set('prefs', 'opaque');

	print "<br />Checking what we inserted: <pre>";
	var_dump($USER->get_user_fields());

	print "</pre><br />Adding this user into the DB....";
	$id = $USER->add();
	if(!$id) {
		print "Adding user failed";
		exit();
	}
	print "Yay! Inserted into ID: " . $id;

	print "<br />Now check inside the tables and confirm...";
	print "<br />Last Error: " . $DB->last_error();
*/


// testing remove()
/*$victim = "falkie";
print "<br />We want to delete/disable $victim";

if($USER->getUserName($victim)) {
	print "<br />Found $victim";
	
	//var_dump($USER->get_user_fields());
	
	if($USER->remove()) { 
		print "<br />REMOVED!"; 
	} else {
		print "<br />Not Removed";
	}
	
} else {
	print "<br />Couldn't find $victim";
}
*/


?>
